home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / fgl110c.zip / 09-01.C < prev    next >
Text File  |  1992-01-31  |  795b  |  41 lines

  1. #include <fastgraf.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. void main(void);
  6.  
  7. char perimeter[] = {
  8.    0xFF,0x80,0x41,0x00,0x22,0x00,0x14,0x00,0x08,0x00
  9.    };
  10. char interior[] = {
  11.    0x00,0x00,0x3E,0x00,0x1C,0x00,0x08,0x00,0x00,0x00
  12.    };
  13.  
  14. void main()
  15. {
  16.    int old_mode, new_mode;
  17.  
  18.    new_mode = fg_bestmode(320,200,1);
  19.    if (new_mode < 0 || new_mode == 12) {
  20.       printf("This program requires a 320 ");
  21.       printf("x 200 color graphics mode.\n");
  22.       exit(1);
  23.       }
  24.  
  25.    old_mode = fg_getmode();
  26.    fg_setmode(new_mode);
  27.  
  28.    fg_setcolor(7);
  29.    fg_rect(0,319,0,199);
  30.  
  31.    fg_move(156,101);
  32.    fg_setcolor(1);
  33.    fg_drawmap(perimeter,2,5);
  34.    fg_setcolor(2);
  35.    fg_drawmap(interior,2,5);
  36.    fg_waitkey();
  37.  
  38.    fg_setmode(old_mode);
  39.    fg_reset();
  40. }
  41.